﻿<%@ Page Language="C#" MasterPageFile="~/Template.master" AutoEventWireup="true"
    CodeFile="NewInvoice.aspx.cs" Inherits="NewInvoice" Title="Ghasam Co. | New Invoice" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="smInvoice" runat="server" />
    
    
    <asp:UpdatePanel ID="upInvoice" RenderMode="Inline" UpdateMode="Always" runat="server">
     <ContentTemplate>
       <asp:Panel ID="pnlNewInvoice" DefaultButton="btnSave" runat="server">
        <div class="title">
            ثبت صورت حساب جدید
        </div>
        <hr />
        <div style="padding: 5px 0">
            <asp:RadioButton Id="rbCash" runat="server" OnCheckedChanged="rbCash_CheckedChanged"
                AutoPostBack="True" GroupName="Cash" />
            &nbsp; نقدی
            <asp:TextBox ID="txtOneTimeCustomer" Enabled="false" runat="server" />
        </div>
        <div style="padding: 5px 0">
            <asp:RadioButton Id="rbNotCash" runat="server" OnCheckedChanged="rbNotCash_CheckedChanged"
                AutoPostBack="True" GroupName="Cash" />
            &nbsp; نسیه
            <asp:DropDownList ID="ddlCustomers" Enabled="false" runat="server" AppendDataBoundItems="True"
                DataTextField="CustomerName" AutoPostBack="true" DataValueField="Id"
                OnSelectedIndexChanged="ddlCustomers_SelectedIndexChanged">
                <asp:ListItem Value="-1">---</asp:ListItem>
            </asp:DropDownList>

        </div>
        <div style="padding: 5px 0">
            شماره کامیون
            <asp:TextBox ID="txtVehicleNumber" runat="server" />
        </div>

        <div style="padding: 5px 0">
            وزن پر
            <asp:TextBox ID="txtGrossWeight" Text="0" runat="server" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtEmptyWeight"
                ErrorMessage="لطفا وزن را به عدد وارد کنید" runat="server" />
        </div>
        <div style="padding: 5px 0">
            وزن خالی
            <asp:TextBox ID="txtEmptyWeight" Text="0" runat="server" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtEmptyWeight"
                ErrorMessage="لطفا وزن را به عدد وارد کنید" runat="server" />
        </div>
        <div style="padding: 5px 0">
            کالا
            <asp:DropDownList ID="ddlGoods" runat="server" AppendDataBoundItems="true"
                DataTextField="Name" DataValueField="Id" AutoPostBack="True" OnSelectedIndexChanged="ddlGoods_SelectedIndexChanged">
                <asp:ListItem Text="---" Value="-1" />
            </asp:DropDownList>

        </div>
        
        وزن خالص :
        <asp:TextBox ID="txtNetWeight" ReadOnly="true" runat="server" />
        &nbsp; x &nbsp; قیمت واحد :
        <asp:TextBox ID="txtUnitPrice" ReadOnly="true" runat="server" />
        = قیمت کل :
        <asp:TextBox ID="txtTotalPrice" ReadOnly="true" runat="server" />
        <div style="padding: 5px 0">
        </div>
        </asp:Panel>
      </ContentTemplate>
    </asp:UpdatePanel>
    
    <div>
        <asp:Button ID="btnSave" Text="ذخیره تغییرات" runat="server" OnClick="btnSave_Click" />
    </div>
</asp:Content>
